package com.hyzx.qbasic.admin.domain.repository;

import com.hyzx.qbasic.admin.model.po.ProcessInstancePO;
import com.hyzx.qbasic.admin.model.po.ProcessTaskInstancePO;

import java.util.List;

/**
 * Created by 黄江华 on 2018/11/29
 */

public interface IProcessInstanceRepository {

    boolean startProcessInstance(ProcessInstancePO processInstance, ProcessTaskInstancePO firstTask);

    boolean addProcessInstance(ProcessInstancePO processInstance);

    boolean addProcessInstanceTask(ProcessTaskInstancePO task);

    ProcessInstancePO getProcessInstance(int processInstanceId);

    ProcessInstancePO getProcessInstanceByBusinessKey(String businessKey);

    boolean editProcessInstance(ProcessInstancePO processInstance);

    boolean deleteProcessInstance(String businessKey);

    boolean batchDeleteProcessInstance(List<String> businessKeyList);

    ProcessTaskInstancePO getProcessTaskInstance(int taskInstanceId);

    boolean editProcessTaskInstance(ProcessTaskInstancePO taskInstance);

    boolean completeTask(ProcessInstancePO processInstance, ProcessTaskInstancePO currentTask, ProcessTaskInstancePO nextTask);

    List<ProcessTaskInstancePO> getProcessTaskInstanceByBusinessKey(String businessKey);
}
